import { defineStore } from 'pinia';
import type { Viewer } from 'cesium';

export default defineStore('viewerStore', {
  state: () => ({
    callToGetViewer: undefined as (() => Viewer) | undefined,
  }),
  getters: {
    viewer: (s) => s.callToGetViewer?.(),
  },
  actions: {
    setViewer(viewer: Viewer) {
      this.callToGetViewer = () => viewer;
    },
  },
});
